package team.xyg.cdtu2.controller;

import team.xyg.cdtu2.dto.PlatMapData;
import team.xyg.cdtu2.entity.BuyNumber;
import team.xyg.cdtu2.service.BuyNumberService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (BuyNumber)表控制层
 *
 * @author makejava
 * @since 2022-07-01 11:31:12
 */
@RestController
@RequestMapping("buyNumber")
public class BuyNumberController {
    /**
     * 服务对象
     */
    @Resource
    private BuyNumberService buyNumberService;



    /**
     * 查询各个时间段访问数量
     * @return
     */
    @GetMapping("time")
    public Map<String,Object> queryVisit(){
        List<PlatMapData> list = buyNumberService.queryVisit();
        Map<String, Object> result = new HashMap<>();
        result.put("code",200);
        result.put("message","success");
        result.put("data",list);

        return result;
    }

}

